using Microsoft.SmallBasic.Library;

namespace SmallBasicFun.Quizes
{
	public class TurtleGrader
	{
		public static void GradeMoveTurtle(Question question, int length)
		{
			Tortoise.SetOrientation(0,0,0);
			question.Run();
			question.Result = Tortoise.GetY() == -length;
		}

		public static void GradeTurnTurtle(Question question, int angle)
		{
			GradeTurnTurtle(0, question, angle);
			GradeTurnTurtle(15, question, angle);
		}

		private static void GradeTurnTurtle(int staring, Question question, int angle)
		{
			Tortoise.SetAngle(staring);
			question.Run();
			int amountTurned = Tortoise.GetAngle() - staring;
			question.Result = (amountTurned == angle);
		}
	}
}